@import "checkbox";
// $tree-prefix-cls: ~"${ant-prefix}-tree";
$tree-prefix-cls: "bricks-tree";
$tree-showline-icon-color: "#282828";
$highlight-color: 'red';
$border-radius-sm: 6;
$item-hover-bg: 'yellow';
$disabled-color: 'black';
$component-background: '#333';
$border-width-base: 1;
$border-style-base: 'solid';
$border-color-base: 'green';
$input-disabled-bg: '#999';

// .antCheckboxFn($checkbox-prefix-cls: ~"${ant-prefix}-tree-checkbox");

.bricks-tree {
//   .reset-component;
  margin: 0;
  padding: 0;
  padding-left: 0 !important;

  ol, ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  li {
    padding: 2px 0 0 0;
    margin: 0;
    margin-bottom: 0px !important;
    padding-top: 0px !important;
    list-style: none;
    white-space: nowrap;
    outline: 0;
    line-height: 20px;
    span[draggable],
    span[draggable="true"] {
      user-select: none;
      border-top: 2px transparent solid;
      border-bottom: 2px transparent solid;
      margin-top: -2px;
      /* Required to make elements draggable in old WebKit */
    //   -khtml-user-drag: element;
    //   -webkit-user-drag: element;
    }
    &.drag-over {
      > span[draggable] {
        background-color: $primary-color;
        color: white;
        opacity: 0.8;
      }
    }
    &.drag-over-gap-top {
      > span[draggable] {
        border-top-color: $primary-color;
      }
    }
    &.drag-over-gap-bottom {
      > span[draggable] {
        border-bottom-color: $primary-color;
      }
    }
    &.filter-node {
      > span {
        color: $highlight-color !important;
        font-weight: 500 !important;
      }
    }
    ul {
      margin: 0;
      padding: 0 0 0 18px;
    }
    // 控制title的盒子
    .bricks-tree-node-content-wrapper {
      display: inline-block;
      padding: 0;
      border-radius: $border-radius-sm;
      margin-left: 4px;
      cursor: pointer;
      text-decoration: none;
      // vertical-align: top;
      color: $text-color;
      transition: all .3s;
      position: relative;
      height: 14px;
      line-height: 14px;
      &:hover {
        background-color: $item-hover-bg;
      }
      &.bricks-tree-node-selected {
        // background-color: $primary-color;
        // background-color: $primary-2;
      }
    }
    span {
    //   &.bricks-tree-checkbox {
    //     margin: 4px 4px 0 2px;
    //   }
      &.bricks-tree-switcher,
      &.bricks-tree-iconEle {
        margin: 3.5px 4px 0 1px;
        width: 13px;
        height: 13px;
        line-height: 13px;
        display: inline-block;
        vertical-align: top;
        border: 0 none;
        cursor: pointer;
        outline: none;
        text-align: center;
        position: relative;
      }
      // &.bricks-tree-switcher {
      //   border: 1px solid #b8b8b8
      // }
      &.bricks-tree-iconEle {
        display: none;
      }
      &.bricks-tree-title {
        font-size: 12px;
        font-family: "Microsoft YaHei";
        color: #262626;
      }
      &.bricks-tree-icon_loading {
        position: absolute;
        left: 0;
        top: 1px;
        background: #fff;
        transform: translateX(-100%);
        transition: all .3s;
        &:after {
          font-family:"bricks-icon" !important;
          display: inline-block;
          // content: "\e604";
        //   animation: loadingCircle 1s infinite linear;
          color: $primary-color;
        }
      }
      &.bricks-tree-switcher {
        &.bricks-tree-switcher-noop {
          margin-left: 1px;
          cursor: default;
        }
        &.bricks-tree-switcher_open {
          border: 1px solid #b8b8b8;
            &:after{
                font-family:"bricks-icon" !important;
                font-size: 8px;
                display: inline-block;
                content: "\e616";
                color: #b8b8b8;
                transform: scale(0.8);
                position: absolute;
                top: -0.5px;
                left: -0.5px;
            }
        }
        &.bricks-tree-switcher_close {
          border: 1px solid #b8b8b8;
          &:after {
            font-family:"bricks-icon" !important;
            display: inline-block;
            font-size: 8px;
            content: "\e615";
            color: #b8b8b8;
            transform: scale(0.8);
            position: absolute;
            top: -0.5px;
            left: -0.5px;
          }
        }
      }
    }
    &:last-child > span {
        &.bricks-tree-switcher,
        &.bricks-tree-iconEle {
        &:before {
          display: none;
        }
      }
    }
  }
   li {
    &:first-child {
      padding-top: 5px;
    }
    &:last-child {
      padding-bottom: 0;
      margin-bottom: 0;
    }
  }
  &-child-tree {
    display: none;
    &-open {
      display: block;
    }
  }
//   li&-treenode-disabled {
  li &-treenode-disabled {
    > span:not(.bricks-tree-switcher),
    > .bricks-tree-node-content-wrapper,
    > .bricks-tree-node-content-wrapper span {
      color: $disabled-color;
      cursor: not-allowed;
    }
    > .bricks-tree-node-content-wrapper:hover {
      background: transparent;
    }
  }
  &-icon__open {
    margin-right: 2px;
    vertical-align: top;
  }
  &-icon__close {
    margin-right: 2px;
    vertical-align: top;
  }
  // Tree with line
  //   &&-show-line {
  & &-show-line {
    li {
      position: relative;
      span {
        &.bricks-tree-switcher {
          background: $component-background;
          color: $tree-showline-icon-color;
          // &.bricks-tree-switcher-noop {
          //   .antTreeShowLineIcon("tree-doc-icon");
          //   content: "\e604";
          // }
          // &.bricks-tree-switcher_open {
          //   .antTreeShowLineIcon("tree-showline-open-icon");
          //   content: "\e604";
          // }
          // &.bricks-tree-switcher_close {
          //   .antTreeShowLineIcon("tree-showline-close-icon");
          //   content: "\e604";
          // }
        }
      }
    }
    li:not(:last-child):before {
      content: ' ';
      width: 1px;
      border-left: 1px solid $border-color-base;
      height: 100%;
      position: absolute;
      left: 12px;
      margin: 22px 0;
    }
  }
}
